package com.newlink.building.userinfo.mvp.contract

import com.newlink.building.common_base.base.IModel
import com.newlink.building.common_base.base.IPresenter
import com.newlink.building.common_base.base.IView
import com.newlink.building.common_base.model.bean.DeviceData
import com.newlink.building.common_base.model.bean.DeviceListData
import com.newlink.building.common_base.model.bean.DeviceListRequest
import com.newlink.building.common_base.model.bean.HttpResult
import com.newlink.building.common_base.model.bean.KitDeviceData
import com.newlink.building.common_base.model.bean.StatusData
import io.reactivex.Observable

interface Module_UserInfo_DeviceSettingContract {

    interface Model : IModel {
        fun getDeviceList(request: DeviceListRequest): Observable<HttpResult<DeviceListData>>
        fun editKitDevice(
            token: String,
            deviceData: KitDeviceData
        ): Observable<HttpResult<StatusData>>

        fun addKitDevice(
            token: String,
            deviceData: KitDeviceData
        ): Observable<HttpResult<StatusData>>

        fun deleteKitDevice(token: String, mac: String): Observable<HttpResult<StatusData>>
    }

    interface View : IView {
        fun refreshDeviceList(total: Int, data: MutableList<DeviceData>)
        fun editDeviceResult(success: Boolean)
        fun addDeviceResult(success: Boolean)
        fun deleteDeviceResult(success: Boolean)
    }

    interface Presenter : IPresenter<View> {
        fun getDeviceList(request: DeviceListRequest)
        fun editKitDevice(token: String, deviceData: KitDeviceData)
        fun addKitDevice(token: String, deviceData: KitDeviceData)
        fun deleteKitDevice(token: String, mac: String)
    }
}